-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: parse macro_rules
as macro name
#16314
Conversation
crates/parser/src/grammar/items.rs
Outdated
match macro_call_after_excl(p) { | ||
BlockLike::Block => p.eat(SEMICOLON), | ||
BlockLike::NotBlock => p.expect(SEMICOLON), | ||
}; | ||
m.complete(p, MACRO_CALL); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's undo this change here again, this is semantically different from the previous behavior. foo!{};
is not a valid item parse
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But wait. Was your coment about not doing the eat
or about not having it as macro_call(p: &mut Parser<'_>, m: Marker)
or about both? Because I very much prefer the to add the marker to the signature to be consistent with the other functions.
It's a call of the third token is neither IDENT or TRY
45d8bfe
to
5916da2
Compare
@rustbot ready |
@rustbot author |
77cf4d4
to
76c67dd
Compare
Thanks! |
☀️ Test successful - checks-actions |
Refactor `macro_call` to be consistent with other functions #16314 (comment)
Refactor `macro_call` to be consistent with other functions #16314 (comment)
macro_rules
as macro namemacro_rules
as macro name
This PR makes RA parse
macro_rules! {}
(note the missing identifier) as aMACRO_CALL
instead ofMACRO_RULES
.Fixes #15969.